<!--
 * @Author: wangming
 * @Date: 2021-04-02 14:17:30
 * @LastEditors: wangming
 * @LastEditTime: 2021-04-15 18:10:50
 * @Description: file content
-->
<template>
  <el-form-item
    label="选择关联控件"
    prop="__config.originModelName"
    :rules="rules"
  >
    <el-select
      v-model="value.__config.originModelName"
      placeholder="请选择"
      style="width: 100%"
    >
      <el-option
        :label="i.__config.label"
        :value="i.modelName"
        v-for="i in originModelList"
        :key="i.modelName"
      >
      </el-option>
    </el-select>
  </el-form-item>
</template>

<script>
import basicmixins from './basicmixins';
import { mapActions, mapGetters } from 'vuex';
export default {
  mixins: [basicmixins],
  computed: {
    ...mapGetters(['getFormList']),
    originModelList() {
      return this.getFormList.filter(
        (i) =>
          this.value?.__config.originModelNameList.indexOf(i.tagName) > -1 &&
          !!i.modelName
      );
    },
    rules() {
      return [
        {
          required: true,
          message: '请选择关联控件',
          trigger: 'change',
        },
      ];
    },
  },

  methods: {},
};
</script>

<style lang="scss" scoped></style>
